//using Beauty.Module.Login;
using MonoTouch.UIKit;
using System.Drawing;
namespace Beauty.Module.Pos
{
    public class PosCtrl:TopMenuCtrl
    {
		ServicesVCtrl servicesVCtrl;
		ProductsVCtrl productsVCtrl;
		PackagesVCtrl packagesVCtrl;
		GiftCardsVCtrl giftCardsVCtrl;
		MiscVCtrl miscVCtrl;
		DiscountVCtrl discountVCtrl;
		CreateNewJobshetVCtrl jobSheets;

        public PosCtrl():base(0)
        {
           
			servicesVCtrl = new ServicesVCtrl();
			servicesVCtrl.TabBarItem.Title ="Services";
			servicesVCtrl.TabBarItem.Image = PosUtility.ImageFrom("Menu-service");
			servicesVCtrl.TabBarItem.SelectedImage = PosUtility.ImageFrom("Menu-service1");
			servicesVCtrl.TabBarItem.ImageInsets = new UIEdgeInsets(-10.0f, 60.0f, 12.0f, 0.0f);
			servicesVCtrl.TabBarItem.TitlePositionAdjustment = new UIOffset(2.0f, 20.0f);
			 
            productsVCtrl = new ProductsVCtrl();
			productsVCtrl.TabBarItem.Title = "Products";
			productsVCtrl.TabBarItem.Image = PosUtility.ImageFrom("Menu-product");
			productsVCtrl.TabBarItem.SelectedImage = PosUtility.ImageFrom("Menu-product1");
			productsVCtrl.TabBarItem.ImageInsets = new UIEdgeInsets(-10.0f, 60.0f, 12.0f, 0.0f);
			productsVCtrl.TabBarItem.TitlePositionAdjustment =  new UIOffset(2.0f, 20.0f);

            packagesVCtrl = new PackagesVCtrl();
			packagesVCtrl.TabBarItem.Title = "Packages";
			packagesVCtrl.TabBarItem.Image = PosUtility.ImageFrom("Menu-package");
			packagesVCtrl.TabBarItem.SelectedImage = PosUtility.ImageFrom("Menu-package1");
			packagesVCtrl.TabBarItem.ImageInsets = new UIEdgeInsets(-10.0f, 60.0f, 12.0f, 0.0f);
			packagesVCtrl.TabBarItem.TitlePositionAdjustment = new UIOffset(2.0f, 20.0f);



            giftCardsVCtrl = new GiftCardsVCtrl();
			giftCardsVCtrl.TabBarItem.Title = "Gift Cards";
			giftCardsVCtrl.TabBarItem.Image = PosUtility.ImageFrom("Menu-gift-card");
			giftCardsVCtrl.TabBarItem.SelectedImage = PosUtility.ImageFrom("Menu-gift-card1");
			giftCardsVCtrl.TabBarItem.ImageInsets = new UIEdgeInsets(-10.0f, 55.0f, 12.0f, 0.0f);
			giftCardsVCtrl.TabBarItem.TitlePositionAdjustment = new UIOffset(2.0f, 20.0f);
		 
            miscVCtrl = new MiscVCtrl();
			miscVCtrl.TabBarItem.Title = "Misc";
			miscVCtrl.TabBarItem.Image = PosUtility.ImageFrom("Menu-misc");
			miscVCtrl.TabBarItem.SelectedImage = PosUtility.ImageFrom("Menu-misc1");
			miscVCtrl.TabBarItem.ImageInsets =new UIEdgeInsets(-10.0f, 55.0f, 12.0f, 0.0f);
			miscVCtrl.TabBarItem.TitlePositionAdjustment = new UIOffset(2.0f, 20.0f);

            discountVCtrl = new DiscountVCtrl();
			discountVCtrl.TabBarItem.Title = "Discount";
			discountVCtrl.TabBarItem.Image = PosUtility.ImageFrom("Menu-discount");
			discountVCtrl.TabBarItem.SelectedImage = PosUtility.ImageFrom("Menu-discount1");
			discountVCtrl.TabBarItem.ImageInsets = new UIEdgeInsets(-10.0f, 60.0f, 12.0f, 0.0f);
			discountVCtrl.TabBarItem.TitlePositionAdjustment =  new UIOffset(2.0f, 20.0f);
 
			jobSheets = new CreateNewJobshetVCtrl ();
			jobSheets.TabBarItem.Title = "Open Jobsheets";
			jobSheets.TabBarItem.Image = PosUtility.ImageFrom("Menu-add-item");
			jobSheets.TabBarItem.ImageInsets = new UIEdgeInsets(-10.0f,  80.0f, 12.0f, 0.0f);
			jobSheets.TabBarItem.TitlePositionAdjustment =new UIOffset(2.0f, 20.0f);

			var viewControllers =  new UIViewController[] { servicesVCtrl, productsVCtrl, packagesVCtrl,giftCardsVCtrl,miscVCtrl,discountVCtrl ,jobSheets};
 
            SetViewControllers(viewControllers);

        }

        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
			 
            NavigationController.SetNavigationBarHidden(true, true);
			cmdShowType.TouchUpInside += (object sender, System.EventArgs e) => {
				switch (isNameSelected) {
				case "Services":

					servicesVCtrl.changeLayout ();

					break;
				case "Products": productsVCtrl.changeLayout ();

					break;
				case "Packages": packagesVCtrl.changeLayout ();

					break;
				case "Gift Cards": giftCardsVCtrl.changeLayout ();

					break;
				case "Discount":discountVCtrl.changeLayout ();

					break;
				default:
					break;
				}
				var uibutton = sender as UIButton;
				uibutton.Selected= !uibutton.Selected;
			};

			
        }
    }
}